package cn.xiaye.blog.servlet;

import cn.xiaye.blog.bean.Context;
import cn.xiaye.blog.bean.Message;
import cn.xiaye.blog.dao.MessageDao;

@SuppressWarnings("serial")
public class AddMessage extends FatherServlet{


	@Override
	public String excute(Context context) {
		
		String text = context.getRequest().getParameter("text");
		String name = context.getRequest().getParameter("name");
		String articleId = context.getRequest().getParameter("article_id");
		
		Message message = new Message();
		message.setText(text);
		message.setName(name);
		message.setArticleId(Integer.valueOf(articleId));
		
		MessageDao messageDao = new MessageDao();
		messageDao.insertMessage(message); 
		return "ShowArticle";
	}
	
}
